@import "variables";

@mixin text-overflow(){
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@mixin clearfix(){
  &:after { content: "\0020"; display: block; height: 0; clear: both; visibility: hidden; overflow:hidden;}
  overflow: hidden;
}

@mixin multi-ellipsis($line) {
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: $line;
  /* autoprefixer: ignore next */
  -webkit-box-orient: vertical;
}

@mixin arrow ($size:4px, $color: $color-border-gray) {
  content: '';
  border: $size solid $color;
  display: block;
  width: $size;
  height: $size;
  border-left: 0;
  border-top: 0;
  transform: rotate(45deg);
}

@mixin hairline2($color: $color-border-gray,$font-size, $sides...) {
  @if length($sides) == 0 {
    $sides: bottom;
  }
  position: relative;
  &:before {
    content: ' ';
    display: block;
    position: absolute;
    width: 100%;
    height: 100%;
    left: 0;
    top: 0;
    z-index: 2;
    pointer-events: none;
    box-sizing: border-box;
    @each $side in $sides {
      border-#{$side}: #{$font-size}px solid $color;
    }
  }
  @media (-webkit-device-pixel-ratio: 2) {
    &:before {
      width: 200%;
      height: 200%;
      transform-origin: 0 0;
      transform: scale(0.5);
    }
  }
  @media (-webkit-device-pixel-ratio: 1.5) {
    &:before {
      width: 150%;
      height: 150%;
      transform-origin: 0 0;
      transform: scale(0.6666);
    }
  }
  @media (-webkit-device-pixel-ratio: 3) {
    &:before {
      width: 300%;
      height: 300%;
      transform-origin: 0 0;
      transform: scale(0.3333);
    }
  }
}

@mixin hairline($color: $color-border-gray, $sides...) {
  @if length($sides) == 0 {
    $sides: bottom;
  }
  position: relative;
  &:before {
    content: ' ';
    display: block;
    position: absolute;
    width: 100%;
    height: 100%;
    left: 0;
    top: 0;
    z-index: 2;
    pointer-events: none;
    box-sizing: border-box;
    @each $side in $sides {
      border-#{$side}: 1px solid $color;
    }
  }
  @media (-webkit-device-pixel-ratio: 2) {
    &:before {
      width: 200%;
      height: 200%;
      transform-origin: 0 0;
      transform: scale(0.5);
    }
  }
  @media (-webkit-device-pixel-ratio: 1.5) {
    &:before {
      width: 150%;
      height: 150%;
      transform-origin: 0 0;
      transform: scale(0.6666);
    }
  }
  @media (-webkit-device-pixel-ratio: 3) {
    &:before {
      width: 300%;
      height: 300%;
      transform-origin: 0 0;
      transform: scale(0.3333);
    }
  }
}

@mixin overlay ($zIndex: $z-index-modal) {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(#000, 0.3);
  opacity: 0;
  z-index: $z-index-modal - 1;
  transition: all 0.15s ease-in;
}

@mixin page-view ($animation: sp-anim-popup) {
  $self: &;
  background: $color-bg-gray;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: $z-index-modal + 1;
  visibility: hidden;
  &__overlay {
    @include overlay();
  }
  &__active {
    animation: $animation .2s ease-in-out;
    visibility: visible;
    #{$self}__overlay {
      opacity: 1;
    }
  }
}

@mixin page-scroll ($padding-top: 0, $padding-bottom: 0, $z-index: 1) {
  position: absolute;
  left: 0;
  width: 100%;
  top: $padding-top;
  bottom: $padding-bottom;
  overflow-y: auto;
  overflow-x: hidden;
  transform: translate3d(0,0,0);
  z-index: 1;
  &.is-ipx {
    bottom: $padding-bottom + $ipx-fix-height;
  }
  > div, > view {
    transform: translate3d(0,0,0);
  }
}

@mixin iconfont-gradient ($background) {
  &:before {
    background: $background;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
  }
}

@mixin flexbox(){
  display: flex;
  justify-content: center;
  align-items: center;
}

@mixin inline-flexbox(){
  display: inline-flex;
  justify-content: center;
  align-items: center;
}

@mixin detail-card(){
  margin:0 24px;
  border-radius: 16px;
  box-shadow: 0px 3px 5px 0px #E2E4EA;
  background: #FFFFFF;
  padding:34px 32px;
}

@mixin detail-card2(){
  padding:24px 32px;
  background-color: #fff;
  box-shadow: 0px 3px 5px 0px #E2E4EA;
  width:100%;

  .item{
    font-size: 24px;
    font-weight: 400;
    color: #111A34; 
    margin-top: 6px;
  }
}

@mixin placeholder($color, $font-size) {
  ::-webkit-input-placeholder {
    /* WebKit browsers */
    color: $color;
    font-size: $font-size;
  }
  :-moz-placeholder {
    /* Mozilla Firefox 4 to 18 */
    color: $color;
    font-size: $font-size;
  }
  ::-moz-placeholder {
    /* Mozilla Firefox 19+ */
    color: $color;
    font-size: $font-size;
  }
  :-ms-input-placeholder {
    /* Internet Explorer 10+ */
    color: $color;
    font-size: $font-size;
  }
}

@mixin flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}